import {TreeDataNode} from "antd";

// ScriptTreeQueryProp 脚本查询
export interface ScriptTreeQueryProp {
    id: number;
    typeName?: number;
    expendRoot: boolean;
    isTree: boolean;
}

// ScriptTreeProp 脚本服务
export interface ScriptTreeProp extends TreeDataNode {
    key: number; // key
    parentId: number; // 上级ID
    title: string; // 标题
    itemType: number; // 类型
    isLeaf: boolean; // 是否叶子节点
    children?: ScriptTreeProp[];
}

// ScriptGroupQueryProp 服务分组查询
export interface ScriptGroupQueryProp {
    pId: number;
    name?: string;
}

// ScriptGroupTableProp 服务分组表格属性
export interface ScriptGroupTableProp {
    id: number; // 主键
    title: string; // 标题
    desc?: string; // 描述
    workHome?: string; // 工作目录
    createId: number; // 创建人ID
    createName: string; // 创建人
    createTime: string; // 创建时间吗
}

// GroupOpenDrawerProp 服务分组打开抽屉的属性
export interface GroupOpenDrawerProp {
    createVisible: boolean;
    updateVisible: boolean;
    currGroup?: ScriptGroupTableProp;
}

// GroupCreateDrawerProp 服务分组创建抽屉属性
export interface GroupCreateDrawerProp {
    visible: boolean;
    close: (data?: ScriptTreeProp) => void;
}

// GroupCreateFormProp 服务分组创建表单提交数据
export interface GroupCreateFormProp {
    title: string;
    workHome?: string;
    desc?: string;
}

// GroupUpdateDrawerProp 服务分组编辑抽屉属性
export interface GroupUpdateDrawerProp {
    visible: boolean;
    initData: ScriptGroupTableProp;
    close: (data?: ScriptTreeProp) => void;
}

export interface GroupUpdateFormProp {
    id: number;
    title: string;
    workHome?: string;
    desc?: string;
}